export default class InfiniteLoopGet<T> {

    private list: T[] = [];

    constructor(list: T[]) {
        this.list = list.slice();
    }

    public getItem() {
        const item = this.list.shift();
        this.list.push(item as T);
        return item;
    }

}